﻿using System;
using System.Text;

namespace Zinnia.Extensions
{
    public static class StringExtend
    {

        public static byte[] StrToByte(this string str, Encoding encoding)
        {
            encoding = encoding.NotNull("encoding");
            return encoding.GetBytes(str);
        }

        public static byte[] StrToUtf8Byte(this string str)
        {
            return Encoding.UTF8.GetBytes(str);
        }
    }
}
